<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String ctx = request.getContextPath();
    request.setAttribute("ctx", ctx);
%>
<html>
<head>
    <title>Title</title>
    <script src="/bootstrap/jquery-1.9.1.min.js"></script>
    <link rel="stylesheet" href="${ctx}/css/index_work.css">
</head>
<body>
<form>
    栏目名称:<input type="text" name="name"><br>
    所属栏目:<input type="text" name="lanmu"><br>
    创建人:<input type="text" name="cjren"><br>
    创建时间:<input type="date" name="cjtime"><br>
    <input type="button" value="添加" onclick="add()">
</form>
</body>
<script>
    function add() {
        $.post("${ctx}/add.do",$("form").serialize(),function(data){
            if(data){
                alert("添加成功");
                location.href="${ctx}/list.do";
            }else{
                alert("添加失败");
            }
        })
    }
</script>
</html>
